package cn.sfturing.web;

import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


@Controller
public class BaseController {
    private static Logger log = LoggerFactory.getLogger(BaseController.class);

    // 用户主页
    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String indexOf() {
        log.info("用户登录主页");
        return "index/index";
    }

    // 这个还是用户主页
    @RequestMapping(value = "/index", method = RequestMethod.GET)
    public String index() {
        return "index/index";
    }

    // 联系我们
    @RequestMapping(value = "/contact", method = RequestMethod.GET)
    public String contact() {
        return "contact/contactIndex";
    }

    // 用户联系我们
    @RequestMapping(value = "/logOff", method = RequestMethod.GET)
    public String logOff(HttpSession session) {
        session.invalidate();
        return "index/index";
    }
}
